package org.xg.study.pd;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigDecimal;

/**
 * @author CMG
 * @version 1.0
 * @cLassName PayController
 * @description
 * @date 2021/9/14 14:45
 **/
public class PayController {
    private Logger logger = LoggerFactory.getLogger(PayController.class);

    public boolean doPay(String uId, String tradeId, BigDecimal amount,
                         int channelType, int modeTYpe) {
        //微信支付
        if (1 == channelType) {
            logger.info("模拟微信渠道支付划账开始。uId：{}, tradeId:{}, amount: {}", uId,
                    tradeId, amount);
            if (1 == modeTYpe) {
                logger.info("密码支付，风控校验环境安全");
            } else if (2 == modeTYpe) {
                logger.info("人脸支付，风控校验脸部识别");
            } else if (3 == modeTYpe) {
                logger.info("指纹支付，风控校验指纹信息");
            }
        }
        //支付宝支付
        else if (2 == channelType) {
            logger.info("模拟支付宝渠道支付划账开始。uId: {}, tradeId: {}, amount: {}", uId,
                    tradeId, amount);
            if (1 == modeTYpe) {
                logger.info("密码支付，风控校验环境安全");
            } else if (2 == modeTYpe) {
                logger.info("人脸支付，风控校验脸部识别");
            } else if (3 == modeTYpe) {
                logger.info("指纹支付，风控校验指纹信息");
            }
        }
        return true;
    }
}
